//根据body_id获取查询研发团队人员维护表
let num = $this.model.table_1755329756396_AIvVb.length;
let headData = $this.model; // 表头数据
if (num > 0) {
    let formDataH = new FormData()
    formDataH.append("billId",headData.bill_id);
    const isRes = $this.$http.post("/formsBusiness/getWeihubiaoByBoduId/", formDataH).then(res => {
        let data= isRes.data.data
        if(data >= 1) {
            console.log("研发立项的人员也赋值给【查看计划用户】成功")
        }else{
            console.log("研发立项的人员也赋值给【查看计划用户】失败")
        }
    }).catch(e => {
        $this.$message.error(e.message);
    });

    for (let i = 0; i < num; i++) {
        // let id = $this.$util.uuid(); // 表单id
        let bodyData = $this.model.table_1755329756396_AIvVb[i]; // 表体数据
        // console.log($this.model);
        // ⭐ 只处理 table_body_id 为 null 的行
        if (bodyData.table_body_id !== undefined) continue;
        let saveObj  ={
            //通用字段
            "bill_id": $this.model.bill_id,
            "body_id":bodyData["body_id"],//表体id
            //"parent_id":"",//下推到研发立项的 billid
            "index_id":0,
            "create_date":bodyData["create_date"],
            "table_body_id":bodyData["table_body_id"],
            //查看创建日期是否受牵连
            "create_date":headData.create_date,
            //研发团队人员维护表体下推到研发立项表体
            "body_1755329405770_2px4R":bodyData["body_1755330137938_giM9L"],
            "body_1755329439810_MVNGa":bodyData["body_1755330141834_CFyX9"],
            "body_1755329451171_i9DdK":bodyData["body_1760062619856_hiTa9"],
            "body_1755329525715_iXKqI":bodyData["body_1755330210930_OPKMx"],
            "body_1755329685275_g08P4":bodyData["body_1755408703024_TFV8r"],//项目编号
            "body_1755329872962_WSeZ1_ID":bodyData["body_1755330050538_ooBIy_ID"],//人员名称id
            "body_1755329872962_WSeZ1":bodyData["body_1755330050538_ooBIy"],//人员名称
        }
        console.log("saveObj = ",saveObj);
        let formData = new FormData()
        formData.append('obj', JSON.stringify(saveObj))
        $this.$http.post("/formsBusiness/getWeihubiaoByBoduId/", formData).then(res => {
            let data=res.data.data
            console.log(data)
        }).catch(e => {
            $this.$message.error(e.message);
        });
    }
}

let formDataH = new FormData()
formDataH.append("billId",headData.bill_id); //【注：表头id】
$this.$http.post("/formsBusiness/getNamesFilter/",formDataH)
    .then(res => {
        console.log("res = ",res.data.data);
        if(res.data.data != 0){
            console.log("数据获取成功！");
        }else{
            console.log("数据获取失败~");
        }
    })
    .catch(err => {
        console.log("数据获取错误！")
    })

//==============================================================================
//根据body_id获取查询研发团队人员维护表
let num = $this.model.table_1761621684298_7OBB8.length;
let headData = $this.model; // 表头数据
if (num > 0) {
    for (let i = 0; i < num; i++) {
        // let id = $this.$util.uuid(); // 表单id
        let bodyData = $this.model.table_1761621684298_7OBB8[i]; // 表体数据
        // ⭐ 只处理 table_body_id 为 null 的行
        if (bodyData.table_body_id !== undefined) continue;
        let saveObj  ={
            //通用字段
            "bill_id": $this.model.bill_id,
            "body_id":bodyData["body_id"],//表体id
            "index_id":0,
            "create_date":bodyData["create_date"],
            "table_body_id":bodyData["table_body_id"],
            //查看创建日期是否受牵连
            "create_date":headData.create_date,
            //项目状态变更表体下推到项目立项表体
            "body_1688610447952_3wkmh":bodyData["body_1761621788838_DDwaS"],//人员名称
            "body_1688610447952_3wkmh_ID":bodyData["body_1761621788838_DDwaS_ID"],//人员名称
            "body_1688610524215_DAP8D":bodyData["body_1761621816327_yXxna"],//状态
            "body_1688610546451_EAZeW":bodyData["body_1761621999355_Xbb9y"],//备注
            "body_1688610485722_RuEWp":bodyData["body_1761621804163_wwk07"],//项目角色
        }
        let formData = new FormData()
        formData.append('obj', JSON.stringify(saveObj))
        $this.$http.post("/formsBusiness/getZtbgByBoduId/", formData).then(res => {
            let data=res.data.data
            console.log(data)
        }).catch(e => {
            $this.$message.error(e.message);
        });
    }
}